Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
I created this PR in response to the #27216 issue I opened.
How did you test this change?
I created a sandbox which renders a large React DOM tree with a configurable number of elements and props. These are broken up by LIST, DEPTH, and PROPS. I used the settings LIST = 500, DEPTH = 20, PROPS = 30 to emulate a complex react app and saw a 30-40% reduction in script.
For benchmarking, I used the production version of both the current 18.2.0
createElement
and the production-built custom version of the modifiedcreateElement
as seen in the PR.Sandbox link:
https://codesandbox.io/s/react-create-element-performance-comparison-tpp5cl?file=/src/App.js
What the UI looks like:
What the F12 Performance Trace looks like: